package com.ruoyi.demo.service.impl;

import com.ruoyi.demo.DTO.MeetUserDetailDTO;
import com.ruoyi.demo.domain.CreatedMeet;
import com.ruoyi.demo.mapper.MeetUserDetailMapper;
import com.ruoyi.system.domain.Meet;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MeetUserDetailService {
    @Autowired
    private MeetUserDetailMapper meetUserMapper;

    public MeetUserDetailDTO getMeetDetails(Long meetId) {
        // 获取会议信息
        CreatedMeet createdmeet = meetUserMapper.getMeetById(meetId);
        if (createdmeet != null) {
            // 获取参会人员信息
            List<String> attendees = meetUserMapper.getAttendeesByMeetId(meetId);
            MeetUserDetailDTO meetDetails = new MeetUserDetailDTO();
            meetDetails.setMeet(createdmeet);
            meetDetails.setAttendees(attendees);
            return meetDetails;
        }
        return null;
    }
}
